<template>
	<view>
		<view class="text-xxl padding">
			<text class="text-black text-bold">{{notify.title}}</text>
		</view>
		<view class="content text-left fl padding-left-xs">
			<view class="margin-lr-xs text-gray">
				{{notify.createDate}}
			</view>
		</view>
		<view class="content text-gray text-right padding-right">
			<text class="cuIcon-attention margin-lr-xs"></text> {{notify.views}} 次浏览
		</view>
		<view class="line"></view>
		<view class="padding">
			<view class="text-content text-lg">
				<u-parse :content="notify.content"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	import uParse from "@/components/u-parse/u-parse.vue"
	import {NotifyService} from "@/api/MessageService.js"
	import {Util} from "@/utils/util.js"
	export default {
		data() {
			return {
				notifyId:0,
				notify:undefined,
			}
		},
		onPullDownRefresh() {
			this.loadNotify();
			uni.stopPullDownRefresh();
		},
		onLoad(options) {
			if(options.notifyId){
				this.notifyId=options.notifyId;
			}
			this.loadNotify();
		},
		methods: {
			loadNotify(){
				NotifyService.detailNotify(this.notifyId).then((res)=>{
					this.notify=res;
					if(this.notify.createDate){
						this.notify.createDate=Util.formatDate(Util.parseDate(this.notify.createDate),"YY-MM-DD");
					}
				})
			}
		}
	}
</script>